﻿using System;
using GC_VKMD.MusicDownloaderClient.Abstractions.Interfaces.Helpers;

namespace GC_VKMD.MusicDownloaderClient.Helpers
{
	public class BrowserDialog : IBrowserDialog
	{
		public string FolderBrowserDialog()
		{
			var result = String.Empty;

			var dialog = new System.Windows.Forms.FolderBrowserDialog();

			var dialogResult = dialog.ShowDialog();

			if (dialogResult.Equals(System.Windows.Forms.DialogResult.OK))
				result = dialog.SelectedPath;

			return result;
		}

		public string FileBrowserDialog(string fileDialogFilter)
		{
			var result = String.Empty;

			var dialog = new System.Windows.Forms.OpenFileDialog
			{
				Filter = fileDialogFilter
			};

			var dialogResult = dialog.ShowDialog();

			if (dialogResult.Equals(System.Windows.Forms.DialogResult.OK))
				result = dialog.FileName;

			return result;
		}
	}
}
